package com.future.service.impl;


import com.future.mapper.MusicMapper;
import com.future.pojo.*;
import com.future.service.MusicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MusicServiceImpl implements MusicService {

    @Autowired
    private MusicMapper musicMapper;


    //音乐条数
    @Override
    public int countMusic() {
        return musicMapper.countMusic();
    }

    //歌手条数
    @Override
    public int countSinger() {
        return musicMapper.countSinger();
    }

    //音乐第一条ID
    @Override
    public int musicFirst() {
        return musicMapper.musicFirst();
    }

    //音乐最后一条ID
    @Override
    public int musicFinally() {
        return musicMapper.musicFinally();
    }


    //增加歌曲
    @Override
    public int addMusic(Musics musics) {
        return musicMapper.addMusic(musics);
    }


    //查询所有音乐
    @Override
    public List<Musics> queryAllMusic(int begin, int end) {
        return musicMapper.queryAllMusic(begin, end);
    }


    //查询全部歌手
    @Override
    public List<Users> queryAllSinger(int begin, int end) {
        return musicMapper.queryAllSinger(begin, end);
    }

    //查询音乐是否在我喜欢中
    @Override
    public List<Musiclist> loveHistory(int userId, String mcName) {
        return musicMapper.loveHistory(userId,mcName);
    }


    //删除一个歌曲
    @Override
    public int deleteMusic(int mcId) {
        return musicMapper.deleteMusic(mcId);
    }


    //根据ID查找音乐和专辑信息
    @Override
    public Albmusic queryByIdAlbmusic(int mcId) {
        return musicMapper.queryByIdAlbmusic(mcId);
    }

    //更改音乐信息
    @Override
    public int updateMusic(Musics musics) {
        return musicMapper.updateMusic(musics);
    }

    //根据歌曲相关信息模糊查找
    @Override
    public List<Musics> queryByNameMusic(String mcName,int begin, int end) {
        return musicMapper.queryByNameMusic(mcName,begin,end);
    }


    //根据热度排名
    @Override
    public List<Musics> HotMusic() {
        return musicMapper.HotMusic();
    }

    //热歌榜
    @Override
    public List<Musics> HotFiveMusic() {
        return musicMapper.HotFiveMusic();
    }

    //新歌榜
    @Override
    public List<Musics> NewFiveMusic() {
        return musicMapper.NewFiveMusic();
    }

    //翻唱榜
    @Override
    public List<Musics> FanFiveMusic() {
        return musicMapper.FanFiveMusic();
    }

    //欧美榜
    @Override
    public List<Musics> EngliFiveMusic() {
        return musicMapper.EngliFiveMusic();
    }

    //日韩榜
    @Override
    public List<Musics> RiFiveMusic() {
        return musicMapper.RiFiveMusic();
    }

    //获取一个人的所有歌单
    @Override
    public List<Musiclist> userMusiclist(int userId) {
        return musicMapper.userMusiclist(userId);
    }


    //添加一个歌单
//    @Override
//    public int addMusiclist(int userId,String mclsName) {
//        return musicMapper.addMusiclist(userId,mclsName);
//    }


    //添加默认歌单我喜欢
    @Override
    public int addloveMusiclist(Musiclist musiclist) {
        return musicMapper.addloveMusiclist(musiclist);
    }

    //添加默认我的下载歌单
    @Override
    public int addDownMusiclist(Musiclist musiclist) {
        return musicMapper.addDownMusiclist(musiclist);
    }


    //查询一个歌单中的所有歌曲
    @Override
    public List<Musiclistmusic> queryOnemclist(int userId, String mclsName) {
        return musicMapper.queryOnemclist(userId, mclsName);
    }

    //查找一个人我的下载的歌曲
    @Override
    public List<Musiclistmusic> queryOneDownmclist(int userId) {
        return musicMapper.queryOneDownmclist(userId);
    }

    //查找一个人我喜欢的歌曲
    @Override
    public List<Musiclistmusic> queryOneLovemclist(int userId) {
        return musicMapper.queryOneLovemclist(userId);
    }

//    //更改歌单信息
//    @Override
//    public int updateOnemclist(String mclsName,int userId) {
//        return musicMapper.updateOnemclist(mclsName,userId);
//    }


    //向歌单里面添加歌曲
    @Override
    public int addMusictolist(int userId,String mclsName, String mcName) {
        return musicMapper.addMusictolist(userId,mclsName,mcName);
    }

    //向我喜欢歌单里面添加歌曲
    @Override
    public int addMusictoLovelist(Musiclist musiclist) {
        return musicMapper.addMusictoLovelist(musiclist);
    }

    @Override
    public int addMusicToDownlist(Musiclist musiclist) {
        return musicMapper.addMusicToDownlist(musiclist);
    }


    //向歌单里面删除歌曲
    @Override
    public int deletelistMusic(int mclsId) {
        return musicMapper.deletelistMusic(mclsId);
    }

    //删除一个歌单
    @Override
    public int deleteMusiclist(int userId, String mclsName) {
        return musicMapper.deleteMusiclist(userId, mclsName);
    }

    //添加一个新专辑
    @Override
    public int addAlbum(Album album) {
        return musicMapper.addAlbum(album);
    }

    //查找歌手全部专辑
    @Override
    public List<Album> queryallAlbof(int userId) {
        return musicMapper.queryallAlbof(userId);
    }

    //查询一个专辑内的所有歌曲
    @Override
    public List<Musics> queryOneAlb(int albId) {
        return musicMapper.queryOneAlb(albId);
    }


    //删除一个专辑
    @Override
    public int deleteAlbum(int albId) {
        return musicMapper.deleteAlbum(albId);
    }


    //每日推荐
    @Override
    public List<Album> TuiFiveAlbum() {
        return musicMapper.TuiFiveAlbum();
    }

    //RAP/HIP HOP榜
    @Override
    public List<Album> RapFiveAlbum() {
        return musicMapper.RapFiveAlbum();
    }

    //POP流行榜
    @Override
    public List<Album> PopFiveAlbum() {
        return musicMapper.PopFiveAlbum();
    }

    // FOLK民谣榜
    @Override
    public List<Album> FolkFiveAlbum() {
        return musicMapper.FolkFiveAlbum();
    }

    //SOUNDTRACK影视原声榜
    @Override
    public List<Album> SoundtrackFiveAlbum() {
        return musicMapper.SoundtrackFiveAlbum();
    }

    //ROCK摇滚榜
    @Override
    public List<Album> RockFiveAlbum() {
        return musicMapper.RockFiveAlbum();
    }


    // 添加评论
    @Override
    public int addDiscuss(Discuss discuss) {
        return musicMapper.addDiscuss(discuss);
    }

    //删除评论
    @Override
    public int deleteDis(int disId) {
        return musicMapper.deleteDis(disId);
    }


    @Override
    public List<Discuss> musicDiscuss(int mcId) {
        return musicMapper.musicDiscuss(mcId);
    }

    @Override
    public int totalDis(int mcId) {
        int num = musicMapper.totalDis(mcId);
        return num;
    }

    @Override
    public Musics queryMusicById(int mcId) {
        return musicMapper.queryMusicById(mcId);
    }

    @Override
    public int totalreply(int dis_id) {
        int num = musicMapper.totalreply(dis_id);
        return num;
    }

    @Override
    public int discusslikestatus(int userId) {
        return musicMapper.discusslikeStatus(userId);
    }

    //专辑热度+1
    @Override
    public int addHotAlb(int albId) {
        return musicMapper.addHotAlb(albId);
    }

    //评论热度+1
    @Override
    public int addHotDis(int disId) {
        return musicMapper.addHotDis(disId);
    }

    //歌曲热度+1
    @Override
    public int addHotMusic(int mcId) {
        return musicMapper.addHotMusic(mcId);
    }


    //用户热度+1
    @Override
    public int addHotUser(int userId) {
        return musicMapper.addHotUser(userId);
    }

    @Override
    public int deleteLike(String mcName, int userId) {
        int num = musicMapper.deleteLike(mcName,userId);
        return num;
    }

}
